<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>书籍详情</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f5f5f5;
            margin: 0;
            padding: 0;
        }
        .container {
            width: 80%;
            max-width: 900px;
            margin: 30px auto;
            padding: 20px;
            background: #fff;
            border-radius: 8px;
            box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
        }
        h1 {
            text-align: center;
            color: #333;
            margin-bottom: 20px;
        }
        .card {
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            background: #fff;
        }
        .card-body p {
            margin-bottom: 15px;
        }
        .card-body p strong {
            display: inline-block;
            width: 120px;
            font-weight: bold;
            color: #444;
        }
        .btn {
            display: inline-block;
            padding: 10px 20px;
            font-size: 16px;
            font-weight: bold;
            text-align: center;
            text-decoration: none;
            border-radius: 5px;
            border: none;
            cursor: pointer;
            color: #fff;
            background-color: #007bff;
            transition: background-color 0.3s;
        }
        .btn-secondary {
            background-color: #6c757d;
        }
        .btn-secondary:hover {
            background-color: #5a6268;
        }
        .btn:hover {
            background-color: #0056b3;
        }
        .img-fluid {
            max-width: 100%;
            height: auto;
            border-radius: 4px;
        }
    </style>
</head>
<body>
<div class="container">
    <h1>书籍详情</h1>
    <div class="card">
        <div class="card-body">
            <p><strong>ID:</strong> <span th:text="${book.id}"></span></p>
            <p><strong>书名:</strong> <span th:text="${book.name}"></span></p>
            <p><strong>分类:</strong><span th:text="${book.category}"></span></p>
            <p><strong>作者:</strong> <span th:text="${book.author}"></span></p>
            <p><strong>价格:</strong> <span th:text="${book.price} + ' 元'"></span></p>
            <p><strong>销量:</strong> <span th:text="${book.sales}"></span></p>
            <p><strong>描述:</strong> <span th:text="${book.description}"></span></p>
            <p><strong>图片:</strong>
                <img th:src="${book.imgurl}" alt="书籍图片" class="img-fluid"/>
            </p>
        </div>
    </div>
    <a href="/books" class="btn btn-secondary mt-3">返回书籍列表</a>
</div>
</body>
</html>
